{% extends 'base_main.html' %}
{% block title %}
<title>修改栏目</title>
{% endblock %}
{% block content%}
{{block.super}}
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-lg-10 col-md-offset-2 main" id="main">
    <h1 class="page-header">修改栏目</h1>
    <form action="" method="post">
        {% csrf_token %}
        <div class="form-group">
            <label for="category-name">栏目名称</label>
            <input type="text" id="category-name" name="name" value="{{category_id.name}}" class="form-control"
                   placeholder="在此处输入栏目名称" required autocomplete="off">
            <span class="prompt-text">这将是它文章栏目显示的名字。</span></div>
        <div class="form-group">
            <label for="category-alias">栏目别名</label>
            <input type="text" id="category-alias" name="alias" value="{{category_id.alias}}" class="form-control"
                   placeholder="在此处输入栏目别名" required autocomplete="off">
            <span class="prompt-text">“别名”是栏目说明,行业术语。</span></div>
        <div class="form-group">
            <label for="category-fname">父节点</label>
            <select id="category-fname" class="form-control" name="fid">
                <option value="" {% if not category_id.columns_id %} selected{% endif %}>无</option>
                {% for category in category_list %}
                <option value="{{category.id}}" {% if category.id == category_id.columns_id %} selected{% endif %}>
                    {{category.name}}
                </option>
                {% endfor %}

            </select>
            <span class="prompt-text">栏目是有层级关系的，您可以有一个“音乐”分类目录，在这个目录下可以有叫做“流行”和“古典”的子目录。</span></div>
        <div class="form-group">
            <label for="category-keywords">关键字</label>
            <input type="text" id="category-keywords" name="keywords" value="{{category_id.keyword}}"
                   class="form-control" placeholder="在此处输入栏目关键字" autocomplete="off">
            <span class="prompt-text">关键字会出现在网页的keywords属性中。</span></div>
        <div class="form-group">
            <label for="category-describe">描述</label>
            <textarea class="form-control" id="category-describe" name="describe" rows="4" autocomplete="off">{{category_id.desc}}</textarea>
            <span class="prompt-text">描述会出现在网页的description属性中。</span></div>
        <button class="btn btn-primary" type="submit" name="submit">更新</button>
    </form>
</div>
{% endblock %}